package com.huluobo.a2307monthdemo.register

import androidx.lifecycle.MutableLiveData
import com.huluobo.lib_base.entity.UserBean
import com.huluobo.lib_base.mvvm.BaseViewModel
import com.huluobo.lib_base.net.ApiService
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

/**
 *  Created by LC on 2025/9/28.
 */
@HiltViewModel
class RegisterViewModel @Inject constructor(private val apiService: ApiService) : BaseViewModel() {
    val registerSuccess by lazy { MutableLiveData<UserBean>() }
    fun register(map: Map<String, String>) {
        executeNetwork(
            { apiService.register(mapToJson(map)) },
            registerSuccess::postValue
        )
    }
}